<?php
namespace Home\Model;
use Think\Model;
class MemberModel extends Model {
    public function getSellerInfo($cond){

        if(!$cond){
    		return false;
    	}
    	$res = M('member')->join('join ecm_store on ecm_member.user_id = ecm_store.store_id')->where($cond)
    		->find();
    	return $res;
    }
    public function getMemberCount($cond){
        if(!$cond){
            return false;
        }
        $res = M('member')->field("count(*) as sum,FROM_UNIXTIME(reg_time, '%Y-%m-%d') as date")
            ->group('date')
            ->where($cond)
            ->select();

        return $res;
    }

    public function reviseMemberInfo($cond,$data){
        if(!$cond || !$data){
            return false;
        }
        $res = M('member')
            ->where($cond)
            ->save($data);

        return $res;
    }

}